import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JSplitPane;
import javax.swing.JInternalFrame;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.UIManager;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.SystemColor;
import javax.swing.JTable;
import java.awt.Toolkit;

public class Education extends JFrame implements ActionListener{

	private JPanel contentPane;
	private ImageIcon im,im1,back,pen;
	private Container con;
	
	private JButton btnLogIn;
	private JButton btnJoinUs;
	private JButton btnExit;
	private JLabel lblNewLabel;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Education frame = new Education();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */

	public Education() {
		setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\HP\\Desktop\\Icon\\right.jpg.png"));
		setTitle("English Education");
		setBackground(Color.WHITE);
		back=new ImageIcon("b.png");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 412, 300);
		contentPane = new JPanel(){
			public void paintComponent(Graphics g) {
	            
                g.drawImage(back.getImage(), 0, 0, null);
                
                setOpaque(false);
                super.paintComponent(g);
            }
		};
		
		contentPane.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Moi", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(255, 0, 0)));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		contentPane.setLayout(null);
		con = this.getContentPane();
		btnLogIn = new JButton("Log In");
		btnLogIn.setBackground(new Color(255, 153, 153));
		btnLogIn.setBounds(306, 160, 79, 23);
		btnLogIn.addActionListener(this);
			contentPane.add(btnLogIn);
		
		btnJoinUs = new JButton("Join Us");
		btnJoinUs.setBackground(new Color(255, 153, 153));
		btnJoinUs.setBounds(306, 193, 79, 23);
		btnJoinUs.addActionListener(this);
		contentPane.add(btnJoinUs);
		
		btnExit = new JButton("EXIT");
		btnExit.setBackground(new Color(255, 153, 153));
		btnExit.setBounds(306, 226, 79, 23);
		btnExit.addActionListener(this);
		contentPane.add(btnExit);
		ImageIcon im=new ImageIcon("EnglishEdu.png");

	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource().equals(btnLogIn)){
			Login login = new Login();
			login.setVisible(true);
			setVisible(false);
		}else if(e.getSource().equals(btnJoinUs)){
			Enroll enroll = new Enroll();
			enroll.setVisible(true);
			setVisible(false);
		}else if(e.getSource().equals(btnExit)){
			System.exit(0);
		}
		
	}
}